#include <iostream>
#include <d3d9.h>

using namespace std;

int main()
{
	IDirect3D9* d3d = Direct3DCreate9(D3D_SDK_VERSION);
	if( !d3d )
	{
		cout << "d3d check version failed." << endl;
		return -1;
	}
	cout << "d3d check version ok." << endl;	 
	
	UINT n = d3d->GetAdapterCount();
	for(UINT i=0; i<n; i++)
	{
		D3DADAPTER_IDENTIFIER9 id;
		d3d->GetAdapterIdentifier(i, 0, &id);
		cout << "driver :\t" << id.Driver << endl
			<< "desc :\t\t" << id.Description << endl
			<< "device name :\t" << id.DeviceName << endl
			<< endl;
	}		
	
	d3d->Release();
	d3d = NULL;
	return 0;
}